package com.atchangsha.system.dto;

import com.atchangsha.system.entity.CustomerEntity;
import lombok.*;

import java.io.Serializable;
import java.util.List;

@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CustomerDTO implements Serializable {
    /**
     * 编号
     */
    private Long id;
    /**
     * 姓名
     */
    private String name;
    /**
     * 性别
     */
    private String sex;
    /**
     * 手机号
     */
    private String phone;
    /**
     * 积分id
     */
    private double pointId;
    /**
     * 外卖收货地址
     */
    private String address;
    /**
     * 余额
     */
    private double balance;

    /**
     * 将DTO转换成entity
     *
     * @return entity实体
     */
    public CustomerEntity toEntity() {
        return CustomerEntity.builder()
                .id(id)
                .name(name)
                .sex(sex)
                .phone(sex)
                .address(address)
                .balance(balance)
                .build();
    }
}
